package org.web.daotest;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.web.ssm.dao.ShoppingMapper;
import org.web.ssm.dao.UserMapper;
import org.web.ssm.model.Shopping;
import org.web.ssm.model.User;

import java.util.Date;
import java.util.List;

/**
 * Created by LUOLIANG on 2016/6/18.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath:configs/spring-mybatis.xml"})
public class Shoppingdaotest {
    private Logger logger = LogManager.getLogger(Shoppingdaotest.class);
    @Autowired
    private ShoppingMapper shoppingMapper;
    @Autowired
    private UserMapper userMapper;

    @Test
    public void testquery() {
//        List<Shopping> list = shoppingMapper.selectAll("23");
//
//        System.out.println(list);
//        shoppingMapper.insertShopping(new Shopping("火腿",new Date(),false,userMapper.selectByPrimaryKey("23")));
    }

}
